package ipe.viewtest;



import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ViewtestActivity extends Activity {
	private final String TAG = new String("HOVNO");
	private Button cmdShowChild;
	private View.OnClickListener oclShowClick;
	private TextView tvDesc;

	
    protected void launchChildActivity() {
    	Log.d(TAG,"Launch ChildViewActivity");
        Intent i = new Intent(this, ChildViewActivity.class);
        Log.d(TAG,"Launch ChildViewActivity - Got intent, starting activity");
     
        	startActivity(i);
  
    }	
	
	private void showChildWindow(){
		Log.d(TAG, "showChildWindow ...");
		tvDesc.setText("Prepinam...");
		launchChildActivity();
	}
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        cmdShowChild = (Button) findViewById(R.id.btnSwitch);
        tvDesc = (TextView) findViewById(R.id.lblDesc);
        
        oclShowClick = new View.OnClickListener() {
			public void onClick(View v){
				showChildWindow();
			}
        };
        cmdShowChild.setOnClickListener(oclShowClick);
        
    }
    

    
}

